import api from '@/api/index.js'
import {TAG_GET_RESULT,TAG_SYNC} from '../constant'

// 获取
export const getTagsAction = ()=>{

    return async (dispatch)=>{
            const response = await api.tag.get()
            if(response && response.status !==1){
                throw new Error(response.message)
            }

            const data = response.data
            dispatch({type:TAG_GET_RESULT,payload:data})
    }

}

// action: 同步点击标签
export const syncTagAction = (tag)=>({type:TAG_SYNC,payload:tag})
